using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using MoMing.VideoTool.Downloader.Model;

namespace MoMing.VideoTool.Downloader.Infrastructure.EntityConfigurations
{
    public class DownloadLogEntityTypeConfiguration : IEntityTypeConfiguration<DownloadLog>
    {
        public void Configure(EntityTypeBuilder<DownloadLog> builder)
        {
            builder.ToTable("download_log");
            builder.HasKey(x => x.Id);
            builder.Property(dl => dl.Title)
            .HasMaxLength(200).IsRequired();
            builder.Property(dl => dl.Url)
            .HasMaxLength(500).IsRequired();
            builder.Property(dl => dl.FileFullPath)
            .HasMaxLength(300).IsRequired();
            builder.Property(dl => dl.PlateForm)
            .HasMaxLength(50).IsRequired();
        }
    }
}